const methodArray = [
  'upsert', // disables PATCH /Models
  'find', // disables GET /Models
  'replaceOrCreate', // disables PUT /Models
  'create', // disables POST /Models
  'prototype.updateAttributes', // disables PATCH /Models/{id}
  'findById', // disables GET /Models/{id}
  'exists', // disables HEAD /Models/{id}
  'replaceById', // disables PUT /Models/{id}
  'deleteById', // disables DELETE /Models/{id}
  'count',  // disables GET /Models/count
  'findOne', // disables GET /Models/findOne
  'update', // disables POST /Models/updat
  'upsertWithWhere', // disables POST /Models/upsertWithWhere
  'createChangeStream', // disables (GET|POST) /Models/change-stream
  'prototype.__get__batch',
];
function batchDisableRemoteMethod(model, methods=methodArray) {
  if (!methods || !methods.length || methods.length === 0) return;
  methods.forEach(item => {
    model.disableRemoteMethodByName(item);
  });
}

module.exports = {
  batchDisableRemoteMethod,
};
